<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的工单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/common/css/dataTables.bootstrap.css" rel="stylesheet">
    <!--分页样式-->
    <style type="text/css">
        div.green-black{padding:3px;margin:3px;text-align:center;}
        div.green-black a{border:#2c2c2c 1px solid;padding:2px 5px;background: #2c2c2c;color:#fff;margin:0 2px 0 0;text-decoration:none;}
        div.green-black a:hover{border:#aad83e 1px solid;background:#aad83e;color:#fff;}
        div.green-black a:active{border:#aad83e 1px solid;background:#aad83e;color:#fff;}
        div.green-black span.current{border:#aad83e 1px solid;padding:2px 5px;font-weight:bold;background:#aad83e;color:#fff;margin:0 2px 0 0;}
        div.green-black span.disabled{border:#f3f3f3 1px solid;padding:2px 5px;color:#ccc;margin:0 2px 0 0;}
        .code{text-align: center;width: 320px;height: 330px;margin-left: 600px;}
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>我的开户链接</h5>
                </div>
                <div class="ibox-content">
                    <div class="row m-b-sm m-t-sm">

                        <div class="col-md-11">
                            <div class="input-group">
                                <input type="text" id="href" value="<?php echo $_SERVER['SERVER_NAME'];?>/index.php/Home/Index/register/agent/{$user.user_id}" id="href" readonly="readonly" class="input-sm form-control">

                                <span class="input-group-btn"><button type="button" class="btn btn-sm "  id="copy"> 复制</button> </span>
                                <span class="input-group-btn" style="margin-left: 5px;"><button type="button" id="QRCode"  class="btn btn-sm "> 二维码</button> </span>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <div id="code" class="code" style="display: none;">
        <button style="float: right;" id="close">X</button>
    </div>

</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->
<!--<script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>-->
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script type="text/javascript" src="__PUBLIC__/user/js/jquery.qrcode.min.js"></script>

<script>
    $("#copy").on('click',function(){
        var e = document.getElementById("href");//对象是content
        e.select();                     //选择对象
        document.execCommand("Copy");   //执行浏览器复制命令
        layer.msg('复制成功!', {time: 3000});
    });

    $("#QRCode").on('click',function () {
       $("#QRCode").attr("disabled",true);
        var open = $("#href").val();
        $('#code').qrcode(open);
        $("#code").removeAttr("style");
    })
    $("#close").on('click',function () {
        $("#code").css("display","none");
    })
</script>
</body>
</html>
